#ifndef INDCOG_H
#define INDCOG_H

#include <QWidget>
#include <QLabel>
#include <QPainter>

#define COG_DIAMETER_RADIUS 8
#define COORDINATE_RADIUS 168

class IndCog : public QWidget
{
    Q_OBJECT
public:
    explicit IndCog(QWidget* parent = nullptr);
protected:
    void paintEvent(QPaintEvent* event) override;
private:
    QLabel* m_right { nullptr };
    QLabel* m_cog { nullptr };
    QLabel* m_line1 { nullptr };
    QLabel* m_line2 { nullptr };
    QLabel* m_line3 { nullptr };
    double m_CoG_x { 0 };
    double m_CoG_y { 0 };
    QColor m_CoG_color { 0xff003868 };
    int m_warningLimit { 30 };
    int m_controlLimit { 60 };
    int m_eccentricity { 5 };
    QLabel* m_warningText { nullptr };
    QLabel* m_controlText { nullptr };
    QLabel* m_eccentricityText { nullptr };
    QLabel* m_warningValue { nullptr };
    QLabel* m_controlValue { nullptr };
    QLabel* m_eccentricityValue { nullptr };

    void DrawOutsideCircle(QPainter& painter);
    void DrawControlCircle(QPainter& painter);
    void DrawWarningCircle(QPainter& painter);
    void DrawCoordinate(QPainter& painter);
    void DrawCoG(QPainter& painter);
    void SetCoGColor(QColor color);
    void SetLines();
    void SetText();
signals:
};

#endif // INDCOG_H
